package com.gmm.springboot.admin.config;

import javax.sql.DataSource;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.boot.jdbc.DataSourceBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class DataSourceConfig {
	@Bean(name = "dataSourceDbTest01")
	@ConfigurationProperties(prefix = "spring.datasource.dbtest01") // application.properties中对应属性的前缀
	public DataSource dataSourceDbTest01() {
		return DataSourceBuilder.create().build();
	}

	@Bean(name = "dataSourceDbTest02")
	@ConfigurationProperties(prefix = "spring.datasource.dbtest02") // application.properties中对应属性的前缀
	public DataSource dataSourceDbTest02() {
		return DataSourceBuilder.create().build();
	}
}
